/*
 * @Author       : 邱狮杰
 * @Date         : 2021-09-01 11:26:41
 * @LastEditTime: 2021-09-05 18:04:20
 * @FilePath: /son-code/src/hooks/query.ts
 * @Description  :
 */

import { LocationQueryRaw, useRoute } from "vue-router";

export type PageQuery<T> = LocationQueryRaw & T;

export function useQuery<T>(): [PageQuery<T>] {
  const route = useRoute();
  return [route.query as PageQuery<T>];
}
